Prototype : Implement slug generation feature with UI and tests - #897
Conversation
…ate setup in settings spec, and update gitignore
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #897 +/- ##
=============================================
+ Coverage 75.46% 75.92% +0.46%
- Complexity 2924 2982 +58
=============================================
Files 121 124 +3
Lines 11597 11832 +235
=============================================
+ Hits 8752 8984 +232
- Misses 2845 2848 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dkotter
left a comment
There was a problem hiding this comment.
Overall this looks good, tested well. I've left a handful of comments but let me know if there's questions on any of those. In addition, we'll want to ensure we add proper documentation that matches all of our other experiment docs.
|
@milindmore22 are you able to make the updates from Darin's review above? |
|
@jeffpaul Yes, I’m addressing the PR reviews. The ones with 👍🏼 have been addressed, and I’ll work on the rest of them today. |
…queue script type
…7.0+ compatibility while ignoring graphify output
jeffpaul
left a comment
There was a problem hiding this comment.
In the Slug suggestions modal, when the Regenerate button is loading let's ensure the text there matches other loading states (e.g. "Generating...").
…hecking to avoid unnecessary lookups. Remove temperature param
…duplicate that code. Move remaining CSS out to it's own file. Better mutation observer and popover close
What?
Closes #876
This PR introduces the Slug Generation experimental feature (
ai/slug-generationability & experiment). It provides AI-assisted permalink suggestions directly inside the WordPress Block Editor based on post title, content, and additional context.Open Questions
Both entry points (sidebar popover + pre-publish panel) are currently supported in prototype.
WordPress core natively enforces slug uniqueness on post save, not sure if we should cover this in Slug generation
Not covered in prototype, but we can cover if required.
Why?
Creating concise, keyword-rich, and SEO-friendly permalink slugs often requires extra effort from content creators. This feature streamlines the publishing workflow by automatically suggesting URL-safe slugs within the permalink inspector popover and the pre-publish panel.
How?
Abilities API Integration:
WordPress\AI\Abilities\Slug_Generation\Slug_GenerationextendingAbstract_Ability.system-instruction.php) enforcing URL-safe, lowercase, hyphenated slug generation.sanitize_title().Experiment Framework:
WordPress\AI\Experiments\Slug_Generation\Slug_GenerationunderExperiment_Category::EDITOR.Block Editor UI Components:
.editor-post-url).SlugGenerationModal): Renders a modal interface allowing users to preview, manually edit, select, or regenerate slug options.SlugPrePublishPanel): Adds aPluginPrePublishPanelsidebar card to review or change the post slug prior to publishing.Automated Tests:
Slug_GenerationTest.php) for ability execution, argument validation, and permissions.helpers.ts) for reliable REST API save synchronization during bulk toggle tests.Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity AI
Model(s): Gemini 3.6 Flash
Used for: Initial implementation of ability and experiment classes, React UI components, unit/integration tests, and code documentation. Final changes reviewed and verified by human developer.
Testing Instructions
Screenshots or screencast
Screen.Recording.2026-07-24.at.4.59.49.PM.2.mov
Changelog Entry